﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IConversionHelper.cs" company="CodePlex">
//   Copyright © CodePlex 2012
// </copyright>
// <summary>
//   Conversion Helper interface.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace DataFrameworkGenerator.Interfaces
{
    using System.Collections.Generic;

    /// <summary>
    /// Conversion Helper interface.
    /// </summary>
    public interface IConversionHelper
    {
        /// <summary>
        /// Gets or sets the target schema.
        /// </summary>
        /// <value>The target schema.</value>
        string TargetSchema { get; set; }

        /// <summary>
        /// Converts the type of the data type int to db data.
        /// </summary>
        /// <param name="metadata">The metadata.</param>
        /// <returns>a propertly formated DbType name.</returns>
        string ConvertDataTypeToDbDataType(ColumnMetadata metadata);

        /// <summary>
        /// Converts the type of the data type int to code.
        /// </summary>
        /// <param name="metadata">The metadata.</param>
        /// <returns>a properly formatted c# variable type.</returns>
        string ConvertDataTypeToCodeType(ColumnMetadata metadata);

        /// <summary>
        /// Fetches the db tables.
        /// </summary>
        /// <param name="connectionString">The connection string.</param>
        /// <returns>
        /// A list containing all the tables in the provided schema.
        /// </returns>
        IList<string> FetchDbTables(string connectionString);

        /// <summary>
        /// Fetches the table column metadata.
        /// </summary>
        /// <param name="connectionString">The connection string.</param>
        /// <param name="tableName">Name of the table.</param>
        /// <returns>A list containing each column and it's metadata.</returns>
        IList<ColumnMetadata> FetchTableColumnMetadata(string connectionString, string tableName);
    }
}